function [position,isterminal,direction] =posXcrossing(~,S) 

y = S(2);
x = S(1);
if x > 0
    position = y;
    isterminal = 1;
else
    position = 100;
    isterminal = 0;
end
direction = 0;   % The zero can be approached from either direction